#ifndef _CONFIG_H
#define _CONFIG_H

#include <QSqlDatabase>
#include <QSqlError>
#include <QSqlQuery>
#include <QJsonObject>
#include <QJsonParseError>
#include <QCryptographicHash>
#include <QFileDialog>
#include "log.h"
#include "httpcommon.h"
#include "ui_config.h"
#include "globaldata.h"

class Config : public QWidget {
	Q_OBJECT
public:
	Config(QWidget *parent = 0);
	~Config();

	public Q_SLOTS:
	void on_pbSure_clicked();
	void on_pbFileStorageDir_clicked();

Q_SIGNALS:
	void quitConfigSignal();
	void showMessageSignal(QString, int);

private:
	void initDb();
	void loadConfigData();
	void initWidget();
	void updateConfig(QString key, QString value);

private:
	Ui::Config ui;
	QSqlDatabase m_database;
	QSqlQuery m_sqlQuery;
};

#endif//_CONFIG_H
